#include "fighter.h"

fighter::fighter()
{
}

fighter::~fighter()
{
}


void fighter::Load()
{
	mSprite.Load("fighter.png");
}

void fighter::Unload()
{
	mSprite.Unload();
}

void fighter::Update(float deltaTime)
{
	const float kSpeed =  1000.0f;
	if (Input_IsKeyDown(Keys::RIGHT))
	{
		mPosition.x += kSpeed * deltaTime;
	}
	else if (Input_IsKeyDown(Keys::LEFT))
	{
		mPosition.x -=  kSpeed * deltaTime;
	}
	if (Input_IsKeyDown(Keys::UP))
	{
		mPosition.y -= kSpeed * deltaTime;
	}
	else if (Input_IsKeyDown(Keys::DOWN))
	{
		mPosition.y += kSpeed * deltaTime;
	}
}

void fighter::Render()
{
	int width = mSprite.GetWidth();
	int height =mSprite.GetHeight();
	SVector2 offset(width * 0.5f, height * 0.5f);
	SVector2 renderPosition = mPosition - offset;
	mSprite.SetPosition(renderPosition);
	mSprite.Render();

	
}
